/**
 * 
 */
/**
 * @author junyitan
 *
 */
package com.danlu.mvc;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "/helloworld")
public class HelloWorldController {

    @RequestMapping(value="/index", method = {RequestMethod.GET})
    public ModelAndView index(){
        System.out.println("ghel");
        ModelAndView modelAndView = new ModelAndView();  
        modelAndView.addObject("message", "Hello World!");  
        modelAndView.setViewName("index");  
        return modelAndView;
    }
    @RequestMapping(value="/hello",method= {RequestMethod.GET})
    public String printHello() {
    		ModelMap model = new ModelMap();  
    		model.addAttribute("message", "Spring 3 MVC Hello World");  
    		return "hello"; 
    }
    
}